package com.zznzzn.myweb.mapper;

import com.zznzzn.myweb.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Property;

import java.util.Date;
import java.util.List;


@Mapper
public interface UserMapper {

    //插入用户 username，nickname，salt，password，createtime
    int addUser(User user);

    List<User> queryAllUsers();

    User queryUserById(@Param("id") String uuid);
    User queryUserByName(@Param("name") String username);

    int updateUserToken(@Param("token") String token,@Param("id") String uuid);

    // 更新所有信息除了token username salt exptime status
    int updateUserProfile(User user);
    int updateUserAvatar(@Param("avatar") String path,@Param("color") String color,@Param("id")String uuid);

    int updateUserStatus(@Param("exp") Date exptime,@Param("status") int status,@Param("id") String uuid);

}
